home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / gui / MultiDesktop.lha / MultiDesktop / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-27  |  14.2 KB  |  628 lines

  1. /* Hilfesystem */
  2. #include "multiwindows.h"
  3.  
  4. extern struct MultiWindowsBase *MultiWindowsBase;
  5. extern struct MultiDesktopBase *MultiDesktopBase;
  6. extern struct ExecBase         *SysBase;
  7. extern struct IntuitionBase    *IntuitionBase;
  8.  
  9. struct HelpText *CreateHelpText();
  10. void             DeleteHelpText();
  11. void             ShowHelpText();
  12. void             GadHelpClose();
  13. void             DrawHelpWP();
  14. void             PrintHT();
  15.  
  16. /* ---- Menü-Hilfe updaten */
  17. void MenuHelpUpdate(we)
  18.  struct WindowEntry *we;
  19. {
  20.  UBYTE                    developer[100];
  21.  UBYTE                   *helpStr;
  22.  UBYTE                   *type;
  23.  BOOL                     sys;
  24.  ULONG                    helpID,helpNum,id;
  25.  struct MultiWindowsUser *mw;
  26.  struct MWMenu           *menu;
  27.  struct MWMenuItem       *item,*sub;
  28.  struct Screen           *scr;
  29.  struct HelpText         *ht;
  30.  
  31.  USER;
  32.  scr=we->MHScreen;
  33.  menu=we->MHMenu;
  34.  item=we->MHMenuItem;
  35.  sub=we->MHSubItem;
  36.  if(menu==NULL)
  37.   {
  38.    WaitBOVP(&scr->ViewPort);
  39.    ShowWallpaperRastPort(&scr->RastPort,MultiWindowsBase->HelpWallpaper,1,1,scr->Width-2,scr->Height-3);
  40.    return;
  41.   }
  42.  
  43.  sys=FALSE;
  44.  helpID=0;
  45.  if(we->MHSubItem)
  46.   {
  47.    helpNum=GetTextID(we->MHSubItem->HelpID);
  48.    helpID=we->MHSubItem->HelpID;
  49.    type=GetLStr(535,"SubItem");
  50.    id=we->MHSubItem->ItemID;
  51.    if(we->MHSubItem->Flags & CMI_SYSITEM) sys=TRUE;
  52.   }
  53.  else if(we->MHMenuItem)
  54.   {
  55.    helpNum=GetTextID(we->MHMenuItem->HelpID);
  56.    helpID=we->MHMenuItem->HelpID;
  57.    type=GetLStr(534,"Item");
  58.    id=we->MHMenuItem->ItemID;
  59.    if(we->MHMenuItem->Flags & CMI_SYSITEM) sys=TRUE;
  60.   }
  61.  else if(we->MHMenu)
  62.   {
  63.    helpNum=GetTextID(we->MHMenu->HelpID);
  64.    helpID=we->MHMenu->HelpID;
  65.    type=GetLStr(533,"Menu");
  66.    id=we->MHMenu->MenuID;
  67.    if(we->MHMenu->Flags & CME_SYSMENU) sys=TRUE;
  68.   }
  69.  
  70.  if(mw->DeveloperOn)
  71.   {
  72.    if(sys)
  73.     {
  74.      sprintf(&developer,"~C~B~U%s\n%s-%s, ID=$%08lx\nHelpID=%ld (MultiDesktop-ID)",
  75.              GetLStr(530,"Developer's help"),
  76.              GetLStr(536,"System"),type,id,helpNum);
  77.     }
  78.    else
  79.     {
  80.      sprintf(&developer,"~C~B~U%s\n%s, ID=%ld\nHelpID=%ld",
  81.              GetLStr(530,"Developer's help"),
  82.              type,id,helpNum);
  83.     }
  84.    ht=CreateHelpText(we,&developer);
  85.   }
  86.  else
  87.   {
  88.    if(helpID==0) return;
  89.    helpStr=FindID(MultiDesktopBase->Catalog,helpID);
  90.    ht=CreateHelpText(we,helpStr);
  91.   }
  92.  if(ht==NULL) return;
  93.  
  94.  if(ht->Lines>2) ht->Lines=2;
  95.  WaitBOVP(&scr->ViewPort);
  96.  ShowWallpaperRastPort(&scr->RastPort,MultiWindowsBase->HelpWallpaper,1,1,scr->Width-2,scr->Height-3);
  97.  PrintHT(&scr->RastPort,mw->TextFont,ht,scr->Width-4,2,2,2);
  98.  DeleteHelpText(ht);
  99. }
  100.  
  101. /* ---- Menü-Hilfe schließen */
  102. void MenuHelpClose(we)
  103.  struct WindowEntry *we;
  104. {
  105.  if(we->MHScreen)
  106.   {
  107.    CloseScreen(we->MHScreen);
  108.    we->MHScreen=NULL;
  109.    we->MHMenuItem=NULL;
  110.    we->GHTime=0;
  111.   }
  112. }
  113.  
  114. /* ---- Menü-Hilfe öffnen */
  115. void MenuHelpOpen(we)
  116.  struct WindowEntry *we;
  117. {
  118.  struct MultiWindowsUser *mw;
  119.  struct Screen           *scr;
  120.  struct ColorMap         *cm;
  121.  struct TagItem           tag[10];
  122.  ULONG                    id;
  123.  LONG                     h;
  124.  
  125.  USER;
  126.  GadHelpClose(we);
  127.  
  128.  if(mw->HelpOn==FALSE) return;
  129.  if(we->Window!=IntuitionBase->ActiveWindow) return;
  130.  if(we!=mw->ActiveWindow) return;
  131.  
  132.  id=NTSC_MONITOR_ID;
  133.  if(we->Screen->ViewPort.Modes & LACE)
  134.    id |= HIRESLACE_KEY;
  135.  else
  136.    id |= HIRES_KEY;
  137.  
  138.  h=(3*(mw->TextFont->tf_YSize+we->RastPort->TxSpacing)+6)+6;
  139.  
  140.  tag[0].ti_Tag=SA_Top;
  141.  tag[0].ti_Data=we->Screen->Height-h+MultiWindowsBase->HelpCorrY;
  142.  tag[1].ti_Tag=SA_Height;
  143.  tag[1].ti_Data=h;
  144.  tag[2].ti_Tag=SA_ShowTitle;
  145.  tag[2].ti_Data=FALSE;
  146.  tag[3].ti_Tag=SA_Depth;
  147.  tag[3].ti_Data=we->Screen->BitMap.Depth;
  148.  tag[4].ti_Tag=SA_DisplayID;
  149.  tag[4].ti_Data=GetVPModeID(we->ViewPort);
  150.  tag[5].ti_Tag=TAG_DONE;
  151.  tag[5].ti_Data=0;
  152.  
  153.  we->MHScreen=OpenScreenTagList(NULL,&tag);
  154.  scr=we->MHScreen;
  155.  if(scr)
  156.   {
  157.    cm=we->Screen->ViewPort.ColorMap;
  158.    LoadRGB4(&scr->ViewPort,cm->ColorTable,cm->Count);
  159.    ShowWallpaperRastPort(&scr->RastPort,MultiWindowsBase->HelpWallpaper,1,1,scr->Width-2,scr->Height-3);
  160.    SetDrMd(&scr->RastPort,JAM1);
  161.    SetFont(&scr->RastPort,mw->TextFont);
  162.  
  163.    tag[0].ti_Tag=GT_VisualInfo;
  164.    tag[0].ti_Data=we->VisualInfo;
  165.    tag[1].ti_Tag=GTBB_Recessed;
  166.    tag[1].ti_Data=TRUE;
  167.    tag[2].ti_Data=TAG_DONE;
  168.  
  169.    DrawBevelBoxA(&scr->RastPort,0,0,scr->Width,scr->Height-1,&tag);
  170.   }
  171. }
  172.  
  173. /* ---- Hilfefenster schließen */
  174. void GadHelpClose(we)
  175.  struct WindowEntry *we;
  176. {
  177.  struct Window  *win;
  178.  
  179.  if(we->GHWindow)
  180.   {
  181.    win=we->GHWindow;
  182.    we->GHWindow=NULL;
  183.    UsePointer(we,we->Pointer);
  184.    CloseWindow(win);
  185.   }
  186.  
  187.  we->GHGadget=NULL;
  188. }
  189.  
  190. /* ---- Hilfefenster öffnen */
  191. void GadHelpOpen(we,gad,helpStr)
  192.  struct WindowEntry *we;
  193.  struct MWGadget    *gad;
  194.  UBYTE              *helpStr;
  195. {
  196.  struct MultiWindowsUser *mw;
  197.  struct ExtNewWindow     *nw;
  198.  struct TagItem           tag[4];
  199.  struct Pointer          *po;
  200.  struct ListviewData     *ld;
  201.  struct HelpText         *ht;
  202.  int                      w,h;
  203.  int                      i;
  204.  UBYTE                    developer[150];
  205.  
  206.  USER;
  207.  nw=AllocVec(sizeof(struct ExtNewWindow),MEMF_CLEAR|MEMF_PUBLIC);
  208.  if(nw==NULL) { NoMemory(); return; }
  209.  
  210.  if(mw->DeveloperOn)
  211.   {
  212.    sprintf(&developer,
  213.            "~U~B~C%s\n\nGadgetID: %ld\nHelpID: %ld\n%s: %s\n%s: %s",
  214.            GetLStr(530,"Developer's Help"),
  215.            gad->GadgetID,GetTextID(gad->HelpID),
  216.            GetLStr(531,"Gadget type"),
  217.            FindGTypeName(gad->Type),
  218.            GetLStr(532,"Gadget kind"),
  219.            FindGKindName(gad->Type,gad->Kind));
  220.    ht=CreateHelpText(we,&developer);
  221.   }
  222.  else
  223.    ht=CreateHelpText(we,helpStr);
  224.  if(ht==NULL) { FreeVec(nw); NoMemory(); return; }
  225.  
  226.  /* ---- Fensterdaten berechnen und einstellen ------------------- */
  227.  
  228.  nw->BlockPen=1;
  229.  nw->Screen=we->Screen;
  230.  nw->Type=CUSTOMSCREEN;
  231.  nw->Flags=WFLG_NW_EXTENDED;
  232.  nw->Extension=&tag;
  233.  
  234.  if((gad->Type==MWGAD_GADTOOLS)&&(gad->Kind==LISTVIEW_KIND))
  235.   {
  236.    ld=gad->ExtData;
  237.    w=ld->X2-ld->X1;
  238.    h=ld->Y2-ld->Y1;
  239.   }
  240.  else
  241.   {
  242.    w=gad->NewGadget.ng_Width;
  243.    h=gad->NewGadget.ng_Height;
  244.   }
  245.  
  246.  nw->LeftEdge=we->Window->LeftEdge+gad->NewGadget.ng_LeftEdge+w-6;
  247.  nw->TopEdge=we->Window->TopEdge+gad->NewGadget.ng_TopEdge+h-6;
  248.  
  249.  w=ht->Width;
  250.  h=ht->Height;
  251.  
  252.  if(nw->LeftEdge+w>we->Screen->Width)
  253.   {
  254.    i=we->Window->LeftEdge+(gad->NewGadget.ng_LeftEdge)-w+6;
  255.    if(i>=0) nw->LeftEdge=i;
  256.   }
  257.  
  258.  if(nw->TopEdge+h>we->Screen->Height)
  259.   {
  260.    i=we->Window->TopEdge+(gad->NewGadget.ng_TopEdge)-h+6;
  261.    if(i>=0) nw->TopEdge=i;
  262.   }
  263.  
  264.  tag[0].ti_Tag=WA_InnerWidth;
  265.  tag[0].ti_Data=w;
  266.  tag[1].ti_Tag=WA_InnerHeight;
  267.  tag[1].ti_Data=h;
  268.  tag[2].ti_Tag=WA_AutoAdjust;
  269.  tag[2].ti_Data=TRUE;
  270.  tag[3].ti_Tag=TAG_DONE;
  271.  
  272.  /* ------------- Ausgabe ---------------------------------------- */
  273.  we->GHWindow=OpenWindow(nw);
  274.  if(we->GHWindow)
  275.   {
  276.    if(MultiWindowsBase->HelpPointer)
  277.      ShowPointer(we,MultiWindowsBase->HelpPointer,0);
  278.    ShowHelpText(we->GHWindow,ht);
  279.   }
  280.  
  281.  DeleteHelpText(ht);
  282.  FreeVec(nw);
  283. }
  284.  
  285. /* ---- Zeitimpuls */
  286. void GadHelpTimer(we,mm)
  287.  struct WindowEntry  *we;
  288.  struct MultiMessage *mm;
  289. {
  290.  struct MWGadget         *gad;
  291.  struct MultiWindowsUser *mw;
  292.  UBYTE                   *help;
  293.  APTR                     a,b,c;
  294.  
  295.  USER;
  296.  if(mw->HelpOn==FALSE) return;
  297.  
  298.  if(we->MHScreen!=NULL)
  299.   {
  300.    a=we->MHMenu;
  301.    b=we->MHMenuItem;
  302.    c=we->MHSubItem;
  303.    FindActiveItem(we);
  304.    if((a!=we->MHMenu)||(b!=we->MHMenuItem)||(c!=we->MHSubItem))
  305.      we->GHTime=0;
  306.    we->GHTime++;
  307.    if(we->GHTime==MultiWindowsBase->HelpAvoidFlicker)
  308.      MenuHelpUpdate(we);
  309.   }
  310.  else
  311.   {
  312.    if(mw->HasGadgetHelp)
  313.     {
  314.      gad=we->GHGadget;
  315.      if((we->GHWindow==NULL)&&(gad!=NULL))
  316.       {
  317.        we->GHTime+=10;
  318.        if(we->GHTime>=MultiWindowsBase->HelpTicks)
  319.         {
  320.          help=FindID(mw->Catalog,gad->HelpID);
  321.          GadHelpOpen(we,gad,help);
  322.         }
  323.       }
  324.     }
  325.   }
  326. }
  327.  
  328. /* ---- Mausbewegung */
  329. void GadHelpMouse(we,mm)
  330.  struct WindowEntry  *we;
  331.  struct MultiMessage *mm;
  332. {
  333.  struct Node         *node;
  334.  struct MWGadget     *gad;
  335.  struct MWGadget     *found;
  336.  struct MXData       *mx;
  337.  struct ListviewData *ld;
  338.  UWORD                 x,y,x1,y1,x2,y2;
  339.  
  340.  x=mm->ObjectData[0];
  341.  y=mm->ObjectData[1];
  342.  
  343.  found=NULL;
  344.  for(node=we->GadgetList.lh_Head;node!=&we->GadgetList.lh_Tail;node=node->ln_Succ)
  345.   {
  346.    gad=node;
  347.  
  348.    if((gad->Type==MWGAD_GADTOOLS)&&(gad->Kind==MX_KIND))
  349.     {
  350.      mx=gad->ExtData;
  351.      x1=mx->X1;
  352.      y1=mx->Y1;
  353.      x2=mx->X2;
  354.      y2=mx->Y2;
  355.     }
  356.    else if((gad->Type==MWGAD_GADTOOLS)&&(gad->Kind==LISTVIEW_KIND))
  357.     {
  358.      ld=gad->ExtData;
  359.      x1=ld->X1;
  360.      y1=ld->Y1;
  361.      x2=ld->X2;
  362.      y2=ld->Y2;
  363.     }
  364.    else
  365.     {
  366.      x1=gad->NewGadget.ng_LeftEdge;
  367.      y1=gad->NewGadget.ng_TopEdge;
  368.      x2=x1+gad->NewGadget.ng_Width;
  369.      y2=y1+gad->NewGadget.ng_Height;
  370.     }
  371.  
  372.    if((x1<=x)&&(y1<=y) && (x2>=x)&&(y2>=y))
  373.     {
  374.      found=gad;
  375.      break;
  376.     }
  377.   }
  378.  if((found==NULL)||(found->HelpID==0))
  379.   {
  380.    GadHelpClose(we);
  381.    return;
  382.   }
  383.  
  384.  if(found!=we->GHGadget)
  385.   {
  386.    we->GHGadget=found;
  387.    we->GHTime=0;
  388.   }
  389. }
  390.  
  391. /* ---- Online-Hilfe und Developer-Items updaten */
  392. void UpdateHelpItems()
  393. {
  394.  struct MultiWindowsUser *mw;
  395.  struct WindowEntry      *we;
  396.  int                      i;
  397.  
  398.  USER;
  399.  for(i=0;i<MAXWINDOWS;i++)
  400.   {
  401.    we=mw->WindowList[i];
  402.    if(we!=NULL)
  403.     {
  404.      if((we->MenuOn)&&(!we->Iconify))
  405.        ClearMenuStrip(we->Window);
  406.  
  407.      if(mw->HelpOn)
  408.        we->HelpOnItem->MenuItem.Flags |= CHECKED;
  409.      else
  410.        we->HelpOnItem->MenuItem.Flags &= ~CHECKED;
  411.      if(mw->DeveloperOn)
  412.        we->DeveloperOnItem->MenuItem.Flags |= CHECKED;
  413.      else
  414.        we->DeveloperOnItem->MenuItem.Flags &= ~CHECKED;
  415.  
  416.      if((we->MenuOn)&&(!we->Iconify))
  417.        SetMenuStrip(we->Window,we->FirstMenu);
  418.     }
  419.   }
  420. }
  421.  
  422. /* ---- Hilfe einschalten */
  423. void HelpOn()
  424. {
  425.  struct MultiWindowsUser *mw;
  426.  
  427.  USER;
  428.  mw->HelpOn=TRUE;
  429.  UpdateHelpItems();
  430. }
  431.  
  432. /* ---- Hilfe ausschalten */
  433. void HelpOff()
  434. {
  435.  struct MultiWindowsUser *mw;
  436.  int                     i;
  437.  
  438.  USER;
  439.  mw->HelpOn=FALSE;
  440.  UpdateHelpItems();
  441.  for(i=0;i<MAXWINDOWS;i++)
  442.   {
  443.    if(mw->WindowList[i])
  444.     {
  445.      GadHelpClose(mw->WindowList[i]);
  446.      MenuHelpClose(mw->WindowList[i]);
  447.      mw->WindowList[i]->GHGadget=NULL;
  448.     }
  449.   }
  450. }
  451.  
  452. /* ---- Developer-Modus einschalten */
  453. void DeveloperOn()
  454. {
  455.  struct MultiWindowsUser *mw;
  456.  
  457.  USER;
  458.  mw->DeveloperOn=TRUE;
  459.  UpdateHelpItems();
  460. }
  461.  
  462. /* ---- Developer-Modus ausschalten */
  463. void DeveloperOff()
  464. {
  465.  struct MultiWindowsUser *mw;
  466.  
  467.  USER;
  468.  mw->DeveloperOn=FALSE;
  469.  UpdateHelpItems();
  470. }
  471.  
  472. /* ---- Hilfetext erstellen */
  473. struct HelpText *CreateHelpText(we,helpStr)
  474.  struct WindowEntry *we;
  475.  UBYTE              *helpStr;
  476. {
  477.  struct MultiWindowsUser *mw;
  478.  UBYTE                   *help;
  479.  struct HelpText         *ht;
  480.  struct RastPort         *rp;
  481.  struct TextFont         *font;
  482.  int                      i,len;
  483.  
  484.  /* ---- Speicher beschaffen, Vorbereitungen treffen ------------- */
  485.  
  486.  USER;
  487.  font=mw->TextFont;
  488.  
  489.  len=strlen(helpStr);
  490.  ht=AllocVec(sizeof(struct HelpText)+len+2,MEMF_ANY);
  491.  if(ht==NULL) return(NULL);
  492.  
  493.  strcpy(&ht->HelpString,helpStr);
  494.  help=&ht->HelpString;
  495.  
  496.  BackupRP(we);
  497.  rp=we->RastPort;
  498.  SetFont(rp,font);
  499.  
  500.  /* ---- Hilfetext auswerten ------------------------------------- */
  501.  
  502.  ht->Lines=0;
  503.  ht->Width=0;
  504.  ht->HelpLine[0].String=help;
  505.  ht->HelpLine[0].Flags=0;
  506.  ht->HelpLine[0].Pen=we->DrawInfo->dri_Pens[TEXTPEN];
  507.  
  508.  for(i=0;i<len;i++)
  509.   {
  510.    if(help[i]=='\n')
  511.     {
  512.      help[i]=0x00;
  513.      if(i<len)
  514.       {
  515.        if(ht->Lines==9)
  516.          break;
  517.        else
  518.         {
  519.          ht->HelpLine[ht->Lines].Width=TextLength(rp,ht->HelpLine[ht->Lines].String,
  520.                                                   strlen(ht->HelpLine[ht->Lines].String));
  521.          if(ht->HelpLine[ht->Lines].Width>ht->Width) ht->Width=ht->HelpLine[ht->Lines].Width;
  522.          ht->Lines++;
  523.          ht->HelpLine[ht->Lines].String=&help[i+1];
  524.          ht->HelpLine[ht->Lines].Flags=0;
  525.          ht->HelpLine[ht->Lines].Pen=we->DrawInfo->dri_Pens[TEXTPEN];
  526.         }
  527.       }
  528.     }
  529.    /* ----Kommando-Auswertung --------------------------------- */
  530.    else if(help[i]=='~')
  531.     {
  532.      if((i+1<len)&&(help[i+1]!='~'))
  533.       {
  534.        ht->HelpLine[ht->Lines].String=&help[i+2];
  535.        switch(help[i+1])
  536.         {
  537.          case 'C':
  538.            ht->HelpLine[ht->Lines].Flags |= HLF_CENTER;
  539.           break;
  540.          case 'R':
  541.            ht->HelpLine[ht->Lines].Flags |= HLF_RIGHT;
  542.           break;
  543.          case 'U':
  544.            ht->HelpLine[ht->Lines].Flags |= HLF_UNDERLINE;
  545.           break;
  546.          case 'B':
  547.            ht->HelpLine[ht->Lines].Flags |= HLF_BOLD;
  548.           break;
  549.          case 'I':
  550.            ht->HelpLine[ht->Lines].Flags |= HLF_ITALIC;
  551.           break;
  552.         }
  553.        i++;
  554.       }
  555.     }
  556.   }
  557.  /* ---- Abschließende Berechnungen -------------------------------- */
  558.  ht->HelpLine[ht->Lines].Width=TextLength(rp,ht->HelpLine[ht->Lines].String,
  559.                                           strlen(ht->HelpLine[ht->Lines].String));
  560.  if(ht->HelpLine[ht->Lines].Width>ht->Width) ht->Width=ht->HelpLine[ht->Lines].Width;
  561.  ht->Height=(ht->Lines+1)*(font->tf_YSize+rp->TxSpacing)+6;
  562.  RestoreRP(we);
  563.  
  564.  ht->Width+=30;
  565.  return(ht);
  566. }
  567.  
  568. /* ---- Hilfetext löschen */
  569. void DeleteHelpText(ht)
  570.  struct HelpText *ht;
  571. {
  572.  FreeVec(ht);
  573. }
  574.  
  575. void ShowHelpText(win,ht)
  576.  struct Window   *win;
  577.  struct HelpText *ht;
  578. {
  579.  struct MultiWindowsUser *mw;
  580.  struct RastPort         *rp;
  581.  struct TextFont         *font;
  582.  
  583.  /* ---- Vorbereitungen ------------------------------------------- */
  584.  USER;
  585.  rp=win->RPort;
  586.  
  587.  ShowWallpaperWindow(win,MultiWindowsBase->HelpWallpaper);
  588.  SetDrMd(rp,JAM1);
  589.  SetFont(rp,mw->TextFont);
  590.  PrintHT(rp,mw->TextFont,ht,win->Width,win->BorderTop,win->BorderLeft,win->BorderRight);
  591. }
  592.  
  593. /* ---- Hilfetext-Ausgabe */
  594. void PrintHT(rp,font,ht,Width,BorderTop,BorderLeft,BorderRight)
  595.  struct RastPort *rp;
  596.  struct TextFont *font;
  597.  struct HelpText *ht;
  598.  int              Width,BorderTop,BorderLeft,BorderRight;
  599. {
  600.  int flags,x,y,w,i;
  601.  
  602.  x=15+BorderLeft;
  603.  w=(Width-BorderLeft-BorderRight)-30;
  604.  
  605.  for(i=0;i<=ht->Lines;i++)
  606.   {
  607.    flags=FS_NORMAL;
  608.    if(ht->HelpLine[i].Flags & HLF_UNDERLINE) flags = FSF_UNDERLINED;
  609.    if(ht->HelpLine[i].Flags & HLF_BOLD) flags |= FSF_BOLD;
  610.    if(ht->HelpLine[i].Flags & HLF_ITALIC) flags |= FSF_ITALIC;
  611.    SetSoftStyle(rp,flags,AskSoftStyle(rp));
  612.    SetAPen(rp,ht->HelpLine[i].Pen);
  613.  
  614.    if(ht->HelpLine[i].Flags & HLF_CENTER)
  615.      flags=JSF_CENTER;
  616.    else if(ht->HelpLine[i].Flags & HLF_RIGHT)
  617.      flags=JSF_RIGHT;
  618.    else
  619.      flags=JSF_LEFT;
  620.  
  621.    y=BorderTop+3+(i*(font->tf_YSize+rp->TxSpacing));
  622.  
  623.    WriteText(rp,x,y,w,font->tf_YSize,
  624.                 ht->HelpLine[i].String,flags);
  625.   }
  626. }
  627.  
  628.